/**
* @file		PanelRegime.ixx
* @brief	势力面板
*
*
* @version	1.0
* @author	lveyou
* @date		22-08-03
*
*/

export module PanelRegime;

import DND;
import ResMgr;
import Regime;
import DefOrder;

export class PanelRegime : public UI::Panel
{
public:
	PanelRegime() :
		_open{ false }
	{
		SetSize({ 400, 300 });
		SetAutoCenter(true);
		SetOrder(DefOrder::UI_GAME);


		_grp = CreateGroup();
		_grp->SetDisableLocator(true);
		_grp->SetBackgroud("bg", {400, 300});

		{
			auto txt = UI::Text::Create(g_res->CreateTextTitle());
			txt->GetCoor()->SetPosition({ 10.0, 10.0 });
			//txt->SetLang("ui_regime", to_string(i));
			txt->SetString("势力面板");
			_grp->Add(&txt->_cpts);
		}
		{
			auto btn = g_res->CreateButtonClose();
			btn->GetCoor()->SetPosition({ 400.0, 10.0 });
			_grp->Add(&btn->_cpts);
		}

		//
		_grpLeft = CreateGroup({ 120.0, 40.0 }, {},
			Locator{ {}, {0.0, 64.0}, Locator::Layout::COLUMN });

		//
		size_t size = g_lang->GetTagSize("ui_regime");
		for (size_t i = 0; i < size; ++i)
		{
			auto txt = UI::Text::Create(g_res->CreateTextNormal());
			txt->SetLang("ui_regime", to_string(i));

			_grpLeft->Add(&txt->_cpts);
		}
		
	}
	bool IsOpen()
	{
		return _open;
	}

	void SetOpen(bool open)
	{
		_open = open;
	}

	void Refresh(Regime* regime)
	{

	}
private:
	bool _open;
	UI::Group* _grp;
	UI::Group* _grpLeft;
	UI::Group* _grpRight;

};
